package com.serviceprovider.business.module.admin.user.services.dao.interfaces;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.user.model.OldUser;
import com.serviceprovider.business.module.admin.user.model.UserProfile;
import com.serviceprovider.business.module.admin.user.valueobjects.UserSearchResultVO;
import com.serviceprovider.business.module.user.model.impl.UserSearchCriteria;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;

/**
 * This class manages user profile information.
 */
public interface IProfileService {

    /**
     * Inserts new profile to a specific user.
     *
     * @param user user profile to be inserted.
     * @param userId id of the user
     */
    void save(UserProfile profile, int userId);

    void update(UserProfile profile);

    /**
     * Removes a profile from a user.
     *
     * @param userId id of the user which has probile to be removed.
     */
    void removeByUserId(int userId);

    /**
     * Removes a profile by its id
     *
     * @param id id of the profile to be removed
     */
    void remove(int id);

    /**
     * Finds a profile by id.
     *
     * @param id id of the profile.
     * @return user profile found or null if doesn't exist.
     */
    UserProfile getById(int id);

    /**
     * Gets a profile of a specific user
     *
     * @param userId id of the user
     * @return user profile found or null if doesn't exist.
     */
    UserProfile getByUser(int userId);

    /**
     * Gets a list of profiles based on search criteria
     *
     * @param a search criteria
     * @return a list of user profile with transactions and orders.
     */
    List<UserSearchResultVO> getBySearchCriteria(UserSearchCriteria criteria);

    /**
     * Gets a list of profiles by role
     *
     * @param roleId Role Id to filter search result
     */
    List<UserSearchResultVO> getByRole(int roleId);
}



